package com.niiwoo.activity.event.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description 投资方式（自动，批量，手动）
 * @Author zq
 * @Date 2018/3/21
 */
@Getter
@AllArgsConstructor
public enum InvestTypeEventEnum {

    AUTO(Byte.valueOf("1"), "自动"),
    BATCH(Byte.valueOf("2"), "批量"),
    MANUAL(Byte.valueOf("3"), "手动");

    private Byte type;

    private String desc;

    public static InvestTypeEventEnum valueOf(Byte code) {
        for (InvestTypeEventEnum typeEventEnum : InvestTypeEventEnum.values()) {
            if (code.byteValue() == typeEventEnum.getType()) {
                return typeEventEnum;
            }
        }
        return null;
    }

}
